<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

<ui:composition template="/template.xhtml" >

<ui:define name="panelPrincipal">

            <p:panel header="Usuarios" id="pUsuario" style="height: auto;"  >

                <p:messages showDetail="true" />

                <p:contextMenu for="treeSingle">
                    <p:menuitem value="Habilitar" update="treeSingle" actionListener="#{permisosBean.habilitarMenu}" icon="ui-icon-add" />
                    <p:menuitem value="Bloquear"  update="treeSingle" actionListener="#{permisosBean.bloquearMenu}" icon="ui-icon-close"/>
                </p:contextMenu>
                
                <h:panelGrid columns="3" columnClasses="colTop,colTop,colTop" >

                    <ui:include src="../seguridad/usuarioPermisoI.xhtml" />

                    <p:spacer height="10"/>

                    <p:tree id="treeSingle" value="#{permisosBean.menu}" var="node" rendered="#{not empty permisosBean.usuario}"
                            dynamic="true"
                            selectionMode="single"
                            selection="#{permisosBean.nodoSeleccionado}"
                            style="width: 400px;" >

                        <p:treeNode type="habilitado" icon="ok16">
                            <h:outputText value="#{node}" />
                        </p:treeNode>

                        <p:treeNode type="bloqueado" icon="delete16">
                            <h:outputText value="#{node}" />
                        </p:treeNode>

                    </p:tree>

                    </h:panelGrid>


            </p:panel>
        
    </ui:define>

</ui:composition>
</html>


